package com.stonedt.spider.controller.enterprise;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.stonedt.spider.controller.overseas.OverseasInfo;
import com.stonedt.spider.entity.ResearchReport;
import com.stonedt.spider.entity.Stock;
import com.stonedt.spider.entity.StockFinancial;
import com.stonedt.spider.entity.reportType;
import com.stonedt.spider.service.OptionalStockService;
import com.stonedt.spider.service.ResearchReportService;
import com.stonedt.spider.service.StockService;
import com.stonedt.spider.util.Constance;
import com.stonedt.spider.util.ParamUtil;
import com.stonedt.spider.util.ResultUtil;
import com.stonedt.spider.util.UtilConfig;

@Controller
@RequestMapping("/stock")
public class StockController {
	@Autowired
	private StockService stockService;
	@Autowired
	private OptionalStockService optionalStockService;
	@Autowired
	private ResearchReportService researchReportService;
	
	/**
	 * 发行信息
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/issue_info", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String issue_info(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "launchDate");
		map.put("index", "release_information");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 增发信息
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/additional_info", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String additional_info(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "additionalIssueDate");
		map.put("index", "secondary_information");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多增发信息
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/additional_info-more", method = RequestMethod.GET)
	public ModelAndView additional_info_more(ModelAndView mv) {
		mv.setViewName("/additional_info/additional_info-more");
		return mv;
	}
	
	/**
	 * 违规处理
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/illegalHandle", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String illegalHandle(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publicationDate");
		map.put("index", "handling_of_violation");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多违规处理
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/illegalHandle-more", method = RequestMethod.GET)
	public ModelAndView illegalHandle_more(ModelAndView mv) {
		mv.setViewName("/illegalHandle/illegalHandle-more");
		return mv;
	}
	
	/**
	 * 违规处理详情页面
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/illegalHandle-detail", method = RequestMethod.GET)
	public ModelAndView illegalHandle_detailPage(ModelAndView mv) {
		mv.setViewName("/illegalHandle/illegalHandle-detail");
		return mv;
	}
	
	/**
	 * 违规处理详情数据
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/illegalHandle_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String illegalHandle_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publicationDate");
		map.put("index", "handling_of_violation");
		map.put("page", "1");
		map.put("size", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 对外担保
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/guarantee", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String guarantee(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publicationDate");
		map.put("index", "guaranty");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多对外担保
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/guarantee-more", method = RequestMethod.GET)
	public ModelAndView guarantee_more(ModelAndView mv) {
		mv.setViewName("/guarantee/guarantee-more");
		return mv;
	}
	
	/**
	 * 对外担保详情页面
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/guarantee-detail", method = RequestMethod.GET)
	public ModelAndView guarantee_detailPage(ModelAndView mv) {
		mv.setViewName("/guarantee/guarantee-detail");
		return mv;
	}
	
	/**
	 * 对外担保详情数据
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/guarantee_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String guarantee_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publicationDate");
		map.put("index", "guaranty");
		map.put("page", "1");
		map.put("size", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 高管持股变动
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/manage_shareChange", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String manage_shareChange(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "changeDate");
		map.put("index", "shares_change");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多高管持股变动
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/manage_shareChange-more", method = RequestMethod.GET)
	public ModelAndView manage_shareChange_more(ModelAndView mv) {
		mv.setViewName("/manage_shareChange/manage_shareChange-more");
		return mv;
	}
	
	/**
	 * 分红信息
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/dividend_info", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String dividend_info(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publicationDate");
		map.put("index", "share_out_bonus");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多分红信息
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/dividend_info-more", method = RequestMethod.GET)
	public ModelAndView dividend_info_more(ModelAndView mv) {
		mv.setViewName("/dividend_info/dividend_info-more");
		return mv;
	}
	
	/**
	 * 十大流通股东
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/circulate_shareholder", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String circulate_shareholder(String firm_id, String page, String size, String date) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publish_time");
		map.put("index", "shareholder");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		andParam.add(new ParamUtil("shareholder_nature", "十大流通股东"));
		if(date!=null) {
			andParam.add(new ParamUtil("publish_time", date));
		}
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 配股明细
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/allotShare_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String allotShare_detail(String firm_id, String page, String size, String date) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publicationDate");
		map.put("index", "rights_issue_detail");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 股本结构
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/shareCapital", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String shareCapital(String firm_id, String page, String size, String date) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publicationDate");
		map.put("index", "stock_structure");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多股本结构
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/shareCapital-more", method = RequestMethod.GET)
	public ModelAndView shareCapital_more(ModelAndView mv) {
		mv.setViewName("/shareCapital/shareCapital-more");
		return mv;
	}
	
	/**
	 * 股本结构详情页面
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/shareCapital-detail", method = RequestMethod.GET)
	public ModelAndView shareCapital_detailPage(ModelAndView mv) {
		mv.setViewName("/shareCapital/shareCapital-detail");
		return mv;
	}
	
	/**
	 * 股本结构详情数据
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/shareCapital_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String shareCapital_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publicationDate");
		map.put("index", "stock_structure");
		map.put("page", "1");
		map.put("size", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 财务指标
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/finance_index", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String finance_index(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "financeYear");
		map.put("index", "financial_index");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 利润百分比
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/profit_percentage", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String profit_percentage(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "financeYear");
		map.put("index", "profit_percentage");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 证券信息
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/security_info", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String security_info(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "securities_information");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 网站信息
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/website", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String website(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "website_records");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多网站信息
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/website-more", method = RequestMethod.GET)
	public ModelAndView website_more(ModelAndView mv) {
		mv.setViewName("/website/website-more");
		return mv;
	}
	
	/**
	 * 商标信息
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/trademark_information", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String trademark_information(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "apply_date");
		map.put("index", "trademark_information");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多商标信息
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/trademark_information-more", method = RequestMethod.GET)
	public ModelAndView trademark_information_more(ModelAndView mv) {
		mv.setViewName("/trademark_information/trademark_information-more");
		return mv;
	}
	
	/**
	 * 行政许可
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/administrative_permission", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String administrative_permission(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "administrative_licensing");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多行政许可
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/administrative_permission-more", method = RequestMethod.GET)
	public ModelAndView administrative_permission_more(ModelAndView mv) {
		mv.setViewName("/administrative_permission/administrative_permission-more");
		return mv;
	}
	
	/**
	 * 行政许可详情页面
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/administrative_permission-detail", method = RequestMethod.GET)
	public ModelAndView administrative_permission_detailPage(ModelAndView mv) {
		mv.setViewName("/administrative_permission/administrative_permission-detail");
		return mv;
	}
	
	/**
	 * 行政许可详情数据
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/administrative_permission_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String administrative_permission_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "administrative_licensing");
		map.put("page", "1");
		map.put("size", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 十大股东
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/shareholder", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String shareholder(String firm_id, String page, String size, String date) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publish_time");
		map.put("index", "shareholder");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		if(date!=null) {
			andParam.add(new ParamUtil("publish_time", date));
		}
		map.put("and", andParam);
		List<ParamUtil> notParam=new ArrayList<ParamUtil>();
		notParam.add(new ParamUtil("shareholder_nature", "十大流通股东"));
		map.put("not", notParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 对外投资
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/invest", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String invest(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "investment_enterprise");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("type", "投资机构"));
		andParam.add(new ParamUtil("invest_firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多对外投资
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/invest-more", method = RequestMethod.GET)
	public ModelAndView invest_more(ModelAndView mv) {
		mv.setViewName("/invest/invest-more");
		return mv;
	}
	
	/**
	 * 控股企业
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/controlShare", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String controlShare(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "investment_enterprise");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("type", "控股企业"));
		andParam.add(new ParamUtil("invest_firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多控股企业
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/controlShare-more", method = RequestMethod.GET)
	public ModelAndView controlShare_more(ModelAndView mv) {
		mv.setViewName("/controlShare/controlShare-more");
		return mv;
	}
	
	/**
	 * 分支机构
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/branchFirm", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String branchFirm(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "investment_enterprise");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("type", "分支机构"));
		andParam.add(new ParamUtil("invest_firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多分支机构
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/branchFirm-more", method = RequestMethod.GET)
	public ModelAndView branchFirm_more(ModelAndView mv) {
		mv.setViewName("/branchFirm/branchFirm-more");
		return mv;
	}
	
	/**
	 * 主要人员
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/main_person", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String main_person(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "company_associated_person");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("type", "主要人员"));
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多主要人员
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/main_person-more", method = RequestMethod.GET)
	public ModelAndView main_person_more(ModelAndView mv) {
		mv.setViewName("/main_person/main_person-more");
		return mv;
	}
	
	/**
	 * 主要人员详情页
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/main_person-detail", method = RequestMethod.GET)
	public ModelAndView main_person_detailPage(ModelAndView mv) {
		mv.setViewName("/main_person/main_person-detail");
		return mv;
	}
	
	/**
	 * 主要人员详情数据
	 * @param article_public_id
	 * @return
	 */
	@RequestMapping(value = "/main_person_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String main_person_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "company_associated_person");
		map.put("page", "1");
		map.put("size", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("type", "主要人员"));
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 公司高管
	 * @param firm_id
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/senior", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String senior(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "company_associated_person");
		map.put("page", page);
		map.put("size", size);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("type", "高管"));
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 公司高管详情页
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/senior-detail", method = RequestMethod.GET)
	public ModelAndView senior_detailPage(ModelAndView mv) {
		mv.setViewName("/senior/senior-detail");
		return mv;
	}
	
	/**
	 * 公司高管详情数据
	 * @param article_public_id
	 * @return
	 */
	@RequestMapping(value = "/senior_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String senior_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("index", "company_associated_person");
		map.put("page", "1");
		map.put("size", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<>();
		andParam.add(new ParamUtil("type", "高管"));
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 更多公司高管
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/senior-more", method = RequestMethod.GET)
	public ModelAndView senior_more(ModelAndView mv) {
		mv.setViewName("/senior/senior-more");
		return mv;
	}
	
	/**
	 * 更多立案信息
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/lawsuit_registerInfo-more", method = RequestMethod.GET)
	public ModelAndView lawsuit_registerInfo_more(ModelAndView mv) {
		mv.setViewName("/lawsuit_registerInfo/lawsuit_registerInfo-more");
		return mv;
	}
	
	/**
	 * 更多开庭公告
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/start_announcement-more", method = RequestMethod.GET)
	public ModelAndView start_announcement_more(ModelAndView mv) {
		mv.setViewName("/start_announcement/start_announcement-more");
		return mv;
	}
	
	/**
	 * 更多法院公告
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/tribunal_announcement-more", method = RequestMethod.GET)
	public ModelAndView tribunal_announcement_more(ModelAndView mv) {
		mv.setViewName("/tribunal_announcement/tribunal_announcement-more");
		return mv;
	}
	
	/**
	 * 更多裁判文书
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/judgment-more", method = RequestMethod.GET)
	public ModelAndView judgment_more(ModelAndView mv) {
		mv.setViewName("/judgment/judgment-more");
		return mv;
	}
	
	/**
	 * 更多经营异常
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/run_exception-more", method = RequestMethod.GET)
	public ModelAndView run_exception_more(ModelAndView mv) {
		mv.setViewName("/run_exception/run_exception-more");
		return mv;
	}
	
	/**
	 * 更多行政处罚
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/administration_punish-more", method = RequestMethod.GET)
	public ModelAndView administration_punish_more(ModelAndView mv) {
		mv.setViewName("/administration_punish/administration_punish-more");
		return mv;
	}
	
	/**
	 * 更多股权出质
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/stock_rights-more", method = RequestMethod.GET)
	public ModelAndView stock_rights_more(ModelAndView mv) {
		mv.setViewName("/stock_rights/stock_rights-more");
		return mv;
	}
	
	/**
	 * 更多被执行人
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/executionPerson-more", method = RequestMethod.GET)
	public ModelAndView executionPerson_more(ModelAndView mv) {
		mv.setViewName("/executionPerson/executionPerson-more");
		return mv;
	}
	
	/**
	 * 更多专利信息
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/patent-more", method = RequestMethod.GET)
	public ModelAndView patent_more(ModelAndView mv) {
		mv.setViewName("/patent/patent-more");
		return mv;
	}
	
	/**
	 * 更多软件著作权
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/software-more", method = RequestMethod.GET)
	public ModelAndView software_more(ModelAndView mv) {
		mv.setViewName("/software/software-more");
		return mv;
	}
	
	/**
	 * 更多作品著作权
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/copyright-more", method = RequestMethod.GET)
	public ModelAndView copyright_more(ModelAndView mv) {
		mv.setViewName("/copyright/copyright-more");
		return mv;
	}

	/**
	 * 法律诉讼-立案信息
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/lawsuit_registerInfo", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String lawsuit_registerInfo(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("size", size);
		map.put("index", "stonedt_legalmsg");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("type", "立案信息"));
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 法律诉讼-开庭公告
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/start_announcement", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String start_announcement(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("size", size);
		map.put("index", "stonedt_legalmsg");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("type", "开庭公告"));
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 法律诉讼-法院公告
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/tribunal_announcement", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String tribunal_announcement(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("size", size);
		map.put("index", "stonedt_legalmsg");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("type", "法院公告"));
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 法院公告详情页面
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/tribunal_announcement-detail", method = RequestMethod.GET)
	public ModelAndView tribunal_announcement_detailPage(ModelAndView mv){
		mv.setViewName("tribunal_announcement/tribunal_announcement-detail");
		return mv;
	}
	
	/**
	 * 法院公告详情数据
	 * @param article_public_id
	 * @return
	 */
	@RequestMapping(value = "/tribunal_announcement_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String tribunal_announcement_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("size", "10");
		map.put("index", "stonedt_legalmsg");
		map.put("page", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("type", "法院公告"));
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 裁判文书详情页面
	 */
	@RequestMapping(value = "/judgment-detail", method = RequestMethod.GET)
	public ModelAndView judgment_detailPage(ModelAndView mv){
		mv.setViewName("/judgment/judgment-detail");
		return mv;
	}
	
	/**
	 * 裁判文书详情数据
	 * @param article_public_id
	 * @return
	 */
	@RequestMapping(value = "/judgment_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String judgment_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publishDate");
		map.put("size", "10");
		map.put("index", "judgment");
		map.put("page", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 行政处罚详情页面
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/administration_punish-detail", method = RequestMethod.GET)
	public ModelAndView administration_punish_detailPage(ModelAndView mv) {
		mv.setViewName("/administration_punish/administration_punish-detail");
		return mv;
	}
	
	/**
	 * 行政处罚详情数据
	 * @param article_public_id
	 * @return
	 */
	@RequestMapping(value = "/administration_punish_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String administration_punish_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "judgment_date");
		map.put("size", "10");
		map.put("index", "administrative_punishment");
		map.put("page", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 被执行人详情页面
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/execution_person-detail", method = RequestMethod.GET)
	public ModelAndView execution_person_detailPage(ModelAndView mv) {
		mv.setViewName("/execution_person/execution_person-detail");
		return mv;
	}
	
	/**
	 * 被执行人详情数据
	 * @param article_public_id
	 * @return
	 */
	@RequestMapping(value = "/execution_person_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String execution_person_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publishDate");
		map.put("size", "10");
		map.put("index", "stonedt_executionperson");
		map.put("page", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 专利信息详情页面
	 * @param mv
	 * @return
	 */
	@RequestMapping(value = "/patent-detail", method = RequestMethod.GET)
	public ModelAndView patent_detailPage(ModelAndView mv) {
		mv.setViewName("/patent/patent-detail");
		return mv;
	}
	
	/**
	 * 专利信息详情数据
	 * @param article_public_id
	 * @return
	 */
	@RequestMapping(value = "/patent_detail", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String patent_detailData(String article_public_id) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "applyDay");
		map.put("size", "10");
		map.put("index", "stonedt_patent");
		map.put("page", "1");
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("article_public_id", article_public_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw( j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 法律诉讼-裁判文书
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/judgment", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String judgment(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publishDate");
		map.put("size",size);
		map.put("index", "judgment");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		System.out.println(j.toJSONString());
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 法律诉讼-经营异常
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/run_exception", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String run_exception(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("size", size);
		map.put("index", "business_abnormal");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		System.out.println(j.toJSONString());
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 法律诉讼-行政处罚
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/administration_punish", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String administration_punish(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "judgment_date");
		map.put("size", size);
		map.put("index", "administrative_punishment");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		System.out.println(j.toJSONString());
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 法律诉讼-股权出质
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/stock_rights", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String stock_rights(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "spider_time");
		map.put("size", size);
		map.put("index", "equity_pledge");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> orParam=new ArrayList<ParamUtil>();
		orParam.add(new ParamUtil("pledgee_id", firm_id));
		orParam.add(new ParamUtil("pledger_id", firm_id));
		map.put("or", orParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		System.out.println(j.toJSONString());
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 法律诉讼-被执行人
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/executionPerson", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String executionPerson(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "publishDate");
		map.put("size", size);
		map.put("index", "stonedt_executionperson");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("businessEntity", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		System.out.println(j.toJSONString());
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 知识产权-专利信息
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/patent", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String patent(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "applyDay");
		map.put("size", size);
		map.put("index", "stonedt_patent");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		System.out.println(j.toJSONString());
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 知识产权-作品著作权
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/copyright", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String copyright(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "register_date");
		map.put("size", size);
		map.put("index", "works_copyright");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("firm_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		System.out.println(j.toJSONString());
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/**
	 * 知识产权-软件著作权
	 * @param firm_id
	 * @return
	 */
	@RequestMapping(value = "/software", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
	@ResponseBody
	public String software(String firm_id, String page, String size) {
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("timefield", "register_date");
		map.put("size", size);
		map.put("index", "software_copyright");
		map.put("page", page);
		map.put("type", "infor");
		map.put("times", "");
		map.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("owner_id", firm_id));
		map.put("and", andParam);
		String response = "";
		JSONObject j=new JSONObject(map);
		System.out.println(j.toJSONString());
		Map<String, Object> result = new HashMap<String, Object>();
		List<Map<String, String>> list = new ArrayList<Map<String, String>>();
		try {
			String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
			response = OverseasInfo.sendPostRaw(j.toJSONString(),url,"utf-8");
		} catch (Exception e) {
			e.printStackTrace();
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		if (StringUtils.isNotBlank(response)) {
			JSONObject parseObject = JSON.parseObject(response);
			String totalData = parseObject.getString("count");
			String totalPage = parseObject.getString("page_count");
			JSONArray jsonArray = parseObject.getJSONArray("data");
			for (int i = 0; i < jsonArray.size(); i++) {
				JSONObject jsonObject = jsonArray.getJSONObject(i);
				JSONObject jsonObject2 = jsonObject.getJSONObject("_source");
				Map<String, String> params = JSONObject.parseObject(jsonObject2.toJSONString(), new TypeReference<Map<String, String>>(){});
				list.add(params);
			}
			if (Integer.parseInt(totalData) > 5000) {
				totalPage = "500";
			}
			if (StringUtils.isBlank(totalPage)) {
				totalPage = "1";
			}else if ("0".equals(totalPage)) {
				totalPage = "1";
			}
			result.put("list", list);
			result.put("totalData", totalData);
			result.put("totalPage", totalPage);
		}else {
			result.put("list", list);
			result.put("totalData", 0);
			result.put("totalPage", 1);
		}
		return JSON.toJSONString(result);
	}
	
	/*
	 * 上市公司股票查询
	 */
	@RequestMapping(value = "/list", produces = "text/plain;charset=utf-8")
	public ModelAndView getstocklist(ModelAndView mv,
			@RequestParam(value = "pageNum", defaultValue = "1", required = false) Integer pageNum,
			HttpServletResponse response, HttpServletRequest request) {
		int stocktype = Integer.parseInt(request.getParameter("stocktype"));
		String platename = "";
		if (1 == stocktype) {
			platename = "沪市";
		} else if (2 == stocktype) {
			platename = "深市";
		} else {
			platename = "新三板";
		}
		PageHelper.startPage(pageNum, 25);
		List<Stock> stockList = stockService.stockList(stocktype);
		for (Stock stock : stockList) {
			if (stocktype == 1 || stocktype == 2) {
				stock.setCode(stock.getCode().substring(2, stock.getCode().length()));
			}
		}

		PageInfo<Stock> page = new PageInfo<Stock>(stockList);
		mv.addObject("list", page);
		mv.addObject("platename", platename);
		mv.addObject("stocktype", stocktype);
		mv.setViewName("stock");
		return mv;
	}

	

	/**
	 * 个股详情1
	 * 
	 * @param mv
	 * @param request
	 * @return
	 */
	@RequestMapping("/stockinfo")
	public ModelAndView stockinfo(ModelAndView mv,
			@RequestParam(value = "pageNum", defaultValue = "1", required = false) Integer pagenum,
			@RequestParam(value = "type", defaultValue = "1", required = false) Integer type,
			@RequestParam(value = "company_id",required = true) String company_id,
			HttpServletRequest request) {
		mv.addObject("company_id", company_id);
		String sid = request.getParameter("seed_id");
		if (null != sid) {
			if(sid.equals("optional")){
				mv.addObject("seed_id", sid);
				mv.addObject("seedName", "自选股票");
			}else{
				Integer seed_id = Integer.parseInt(sid);
				mv.addObject("seed_id", seed_id);
				if (seed_id == 25555) {
					mv.addObject("stocktype", 2);
					mv.addObject("seedName", "深市");
				} else if (seed_id == 15555) {
					mv.addObject("stocktype", 1);
					mv.addObject("seedName", "沪市");
				}
			}
		}
		if (request.getParameter("plate_code") != null && request.getParameter("plate_code") != "") {
			mv.addObject("plate_code", request.getParameter("plate_code"));
			mv.addObject("seedName", "产业图谱");
			mv.addObject("resultUrl", "conceptmap/viewmap?type=");
		}
		String code = request.getParameter("code").toString();
		String market = "";
		Stock st = stockService.getstockbaseinfo(code);
		if(st.getCode() != null) {
			if (st.getCode().startsWith("sz")) {
				market = "SZ";
			} else if (st.getCode().startsWith("sh")) {
				market = "SH";
			}
		}
		StockFinancial result = stockService.getFinancial(code);
		mv.addObject("StockFinancial", result);
		String stock = optionalStockService.getstockbaseinfo(code + "." + market);// 得到基本信息
		JSONObject parseObject = JSONObject.parseObject(stock);
		Map map = parseObject;
		
		//查询上市公司详情 
		JSONObject Endjson=stockService.companydetail(company_id);
		mv.addObject("stock", Endjson.getJSONArray("data").getJSONObject(0));
		
		Map<String, Object> mapParam=new HashMap<>();
		mapParam.put("timefield", "date");
		mapParam.put("index", "stock");
		mapParam.put("page", "1");
		mapParam.put("size", "1");
		mapParam.put("type", "infor");
		mapParam.put("times", "");
		mapParam.put("timee", "");
		List<ParamUtil> andParam=new ArrayList<ParamUtil>();
		andParam.add(new ParamUtil("firm_id", company_id));
		mapParam.put("and", andParam);
		JSONObject j=new JSONObject(mapParam);
		String url="http://dx2.stonedt.com:7120/commonsearch/superdatalist";
		String response=OverseasInfo.sendPostRaw(j.toJSONString(), url, "utf-8");
		JSONObject jsonOb = JSONObject.parseObject(response);
		try {
			if(200 == jsonOb.getInteger("code")) {
				JSONArray datas = jsonOb.getJSONArray("data");
				JSONObject data = datas.getJSONObject(0).getJSONObject("_source");
				Double percent=Double.parseDouble(data.getString("percent"));
				data.put("percent", percent);
				mv.addObject("stockInfo", data);
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		mapParam.put("timefield", "spider_time");
		mapParam.put("index", "industry_status");
		j=new JSONObject(mapParam);
		response=OverseasInfo.sendPostRaw(j.toJSONString(), url, "utf-8");
		jsonOb = JSONObject.parseObject(response);
		try {
			if(200 == jsonOb.getInteger("code")) {
				JSONArray datas = jsonOb.getJSONArray("data");
				JSONObject data = datas.getJSONObject(0).getJSONObject("_source");
				mv.addObject("industryStatus", data);
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		mapParam.put("index", "firm_map");
		j=new JSONObject(mapParam);
		response=OverseasInfo.sendPostRaw(j.toJSONString(), url, "utf-8");
		jsonOb = JSONObject.parseObject(response);
		try {
			if(200 == jsonOb.getInteger("code")) {
				JSONArray datas = jsonOb.getJSONArray("data");
				JSONObject data = datas.getJSONObject(0).getJSONObject("_source");
				mv.addObject("firmAtlas", data);
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		mv.addObject("simplename", st.getSimple_name());// 简称
		mv.addObject("code",code);
		mv.setViewName("stockInfo");
		return mv;
	}

	@RequestMapping("/company_details")
	public ModelAndView CompanyDetails(ModelAndView mav) {
		
		mav.addObject("", "");
		mav.setViewName("stockinfo");
		return mav;
	}
	
	@RequestMapping("/sdgd")
	@ResponseBody
	public JSONObject ShiDaGuDong(@RequestParam(name="company_id",required=true) String company_id) {
		return stockService.getShiDa(company_id);
	}
	
	
	@RequestMapping("/persons")
	@ResponseBody
	public JSONObject persons(@RequestParam(name="id",required=true) String id) {
		return stockService.getpersons(id);
	}
	
	/**
	 * 资讯
	 * @param pagenum
	 * @param request
	 * @return
	 */
	@RequestMapping("/getStockNews")
	@ResponseBody
	public ResultUtil getStockNews(
			@RequestParam(value = "pageNum", defaultValue = "1", required = false) Integer pagenum,
			HttpServletRequest request) {
		String code = request.getParameter("code").toString();
		String market = "";
		Stock st = stockService.getstockbaseinfo(code);
		if (st.getCode().startsWith("sz")) {
			market = "SZ";
		} else if (st.getCode().startsWith("sh")) {
			market = "SH";
		}
		PageHelper.startPage(pagenum, 8);
		List<Map<String, Object>> newsList = optionalStockService.getstocknewsbycode(code + "." + market);// 新闻
		for (Map<String, Object> map2 : newsList) {
			int a = (int) (1 + Math.random() * (5));
			map2.put("emotiontype", a);
		}
		PageInfo<Map<String, Object>> newslist = new PageInfo<Map<String, Object>>(newsList);

		return new ResultUtil(200, "", newslist);
	}
	
	/**
	 * 公告
	 * @param pagenum
	 * @param code
	 * @return
	 */
	@RequestMapping("/getNotice")
	public @ResponseBody ResultUtil getNotice(@RequestParam(value = "pageNum", defaultValue = "1", required = false) 
	Integer pagenum, String code) {
		String market = "";
		Stock st = stockService.getstockbaseinfo(code);
		if (st.getCode().startsWith("sz")) {
			market = "SZ";
		} else if (st.getCode().startsWith("sh")) {
			market = "SH";
		}
		String noticecode = code + "." + market;
		PageHelper.startPage(pagenum, Constance.PAGE_SIZE);
		List<Map<String, Object>> noticeList = optionalStockService.getNotice(noticecode);// 返回公告信息
		PageInfo<Map<String, Object>> noticelist = new PageInfo<Map<String, Object>>(noticeList);
		return new ResultUtil(200, "", noticelist);
		
	}
	
	/**
	 * 研报
	 * @param pagenum
	 * @param code
	 * @param rtype
	 * @return
	 */
	@RequestMapping("/getResearchReport")
	public @ResponseBody String getResearchReport(@RequestParam(value = "pageNum", defaultValue = "1", required = false) 
			Integer pagenum, String code,String rtype){
		String market = "";
		Stock st = stockService.getstockbaseinfo(code);
		if (st.getCode().startsWith("sz")) {
			market = "SZ";
		} else if (st.getCode().startsWith("sh")) {
			market = "SH";
		}
		String noticecode = code + "." + market;
		
		PageHelper.startPage(pagenum, Constance.PAGE_SIZE);
		List<ResearchReport> list = researchReportService.getOptionalResearchReport(noticecode,rtype);
		List<reportType> rtypes = researchReportService.getrtyps(noticecode);
		String org = null;
		String rate = null;
		String page = null;
		for (int i = 0; i < list.size(); i++) {
			String time = list.get(i).getPublish_time();
			time = time.substring(0, 10);
			list.get(i).setPublish_time(time);
		}
		if (list != null && list.size() != 0) {
			org = list.get(0).getOrg();
			rate = list.get(0).getRate();
			page = list.get(0).getPagenum();
		}
		PageInfo<ResearchReport> reportlist = new PageInfo<ResearchReport>(list);
		Map<String,Object> map = new HashMap<>();
		map.put("reportlist", reportlist);
		map.put("rtypes", rtypes);
		map.put("rtype1", rtype);
		map.put("org", org);
		map.put("rate", rate);
		map.put("page", page);
		String jsonString = JSON.toJSONString(map);
		return jsonString;
	}
	
/*	@RequestMapping("/getFinancial")
	@ResponseBody
	public ResultUtil getStockNews(HttpServletRequest request) {
		String code = request.getParameter("code").toString();
		ResultUtil result = stockService.getFinancial(code);
		return result;
	}*/
	@RequestMapping("/getPatent")
	@ResponseBody
	public ResultUtil getStockNews(HttpServletRequest request) {
		String code = request.getParameter("code").toString();
		ResultUtil result = stockService.getPatent(code);
		return result;
	}
	
	@RequestMapping("/getKeyDatas")
	public @ResponseBody String getKeyDatas(String code) {
		String stockRevenue = stockService.getStockRevenue(code);
		JSONObject jsStr = JSONObject.parseObject(stockRevenue);//
		JSONArray parseArray = JSONArray.parseArray(jsStr.get("data").toString());
		for (int i = 0; i < parseArray.size(); i++) {
			JSONObject datastr = JSONObject.parseObject(parseArray.get(i).toString());
			String string = datastr.get("revenue").toString();
			double parseDouble = Double.parseDouble(string);
			DecimalFormat df = new DecimalFormat("#.00");
			String format = df.format(parseDouble);
			//System.out.println(format);
			datastr.put("revenue",format);
		}
		String stockEarning = stockService.getStockEarning(code);
		String stockNetProfit = stockService.getStockNetProfit(code);
		String stockResearch = stockService.getStockResearch(code);
		Map<String,Object> map = new HashMap<>();
		map.put("stockRevenue", stockRevenue);
		map.put("stockEarning", stockEarning);
		map.put("stockNetProfit", stockNetProfit);
		map.put("stockResearch", stockResearch);
		String jsonString = JSON.toJSONString(map);
		return jsonString;
	}
	
	@RequestMapping("/getStockJson")
	@ResponseBody
	public String getStockJson(HttpServletRequest request) {
		String code = request.getParameter("code").toString();
		String json = stockService.getStockJson(code);
		return json;
	}
	
	
	
	/***
	 * 获取法律诉讼
	 * @return
	 */
	@RequestMapping("/getLaw")
	@ResponseBody
	public JSONObject getLaw(String id,String iname) {
		return stockService.getLaw(id,iname);
	}
	
	/***
	 * 获取知识产权
	 * @return
	 */
	@RequestMapping("/getIpr")
	@ResponseBody
	public JSONObject getIpr(String id) {
		return stockService.getProperty(id);
	}
}
